package com.continautos.common.web;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;

@ManagedBean(name = "reportesBean")
@SessionScoped
public class ReportesBean {

	private String reporte;
	private String javaScriptExec;
	
	
	
	public void viajarBean(){
		
		FacesContext fc = FacesContext.getCurrentInstance();
		HttpServletRequest req = (HttpServletRequest)fc.getExternalContext().getRequest();

		javaScriptExec = "javascript:window.open('"; 
		javaScriptExec +=  "http://" +
				req.getServerName() + ":" + 
		req.getServerPort() + "/" + 
		"CONTINAUTOSBI" + "/" + 
		"frameset" + "?" + 
		"__report" + "=" + reporte + "." + 
		"rptdesign";
		
		javaScriptExec += "','',"+"'"+ "left=10,top=20,width=900,height=600,resizable=1,scrollbars=1" +"');";
	}



	public String getReporte() {
		return reporte;
	}



	public void setReporte(String reporte) {
		this.reporte = reporte;
	}



	public String getJavaScriptExec() {
		return javaScriptExec;
	}



	public void setJavaScriptExec(String javaScriptExec) {
		this.javaScriptExec = javaScriptExec;
	}
}
